package com.cheryjb.examples.gwt.clock.client;

/**
 * Defines a mathematical 2 dimensions Vector (x,y)
 * 
 * @author Jean-Baptiste Chery
 * 
 */
public class Vector {
	/**
	 * x coordinate of the vector
	 */
	private double x;

	/**
	 * y coordinate of the vector
	 */
	private double y;

	/**
	 * instantiate the vector to (0,0)
	 */
	public Vector() {
		x = 0;
		y = 0;
	}

	/**
	 * instantiate the vector to (x,y)
	 * 
	 * @param x
	 * @param y
	 */
	public Vector(final double x, final double y) {
		this.x = x;
		this.y = y;
	}

	/**
	 * copy constructor
	 * 
	 * @param vector
	 */
	public Vector(final Vector vector) {
		this(vector.getX(), vector.getY());
	}

	// Getters and Setters

	public double getX() {
		return x;
	}

	public double getY() {
		return y;
	}

	public void setX(final double x) {
		this.x = x;
	}

	public void setY(final double y) {
		this.y = y;
	}

}
